#pragma once
#include <GdiPlus.h>
using namespace Gdiplus;

#include <map>
using namespace std;

/// <summary>
/// Auto manage font (GDI+ object) resources.
/// </summary>
/// <remark>
/// None.
/// </remark>
class AFX_EXT_CLASS CFontLib
{
public:
	CFontLib(void);
	~CFontLib(void);

public:
	// Release resource
	void	FreeFonts(void);
	// Return the pointer of Font object
	Font*	GetFont(CString strFontFace, float fFontSize, FontStyle enFontStyle);
protected:
	// Create Font object
	Font*	CreateFont(CString strFontFace, float fFontSize, FontStyle enFontStyle);
protected:
	typedef pair<CString,float> map_Pair1;
	typedef pair<map_Pair1, FontStyle> map_Pair2;
	typedef map<map_Pair2, Font*> map_Fonts;
	map_Fonts m_mapFonts;
};
